# Maintainer: David Runge <dvzrv@archlinux.org>

_name=click-completion
pkgname=python-click-completion
pkgver=0.5.2
pkgrel=7
pkgdesc="Add or enhance bash, fish, zsh and powershell completion in Click"
arch=('any')
url="https://github.com/click-contrib/click-completion"
license=('MIT')
depends=('python-click' 'python-jinja' 'python-six' 'python-shellingham')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
sha512sums=('f63772ab8c7575cb790c0478e965d059c8a9978bfe32b6b7e1322d8183c27bd03bdc4f8ee26ae3af77cf164dd690562ef52e40b95908f014f3cc27f4693e1ff5')

prepare() {
  mv -v "${_name}-$pkgver" "$pkgname-$pkgver"
}

build() {
  cd "$pkgname-$pkgver"
  python setup.py build
}

package() {
  cd "$pkgname-$pkgver"
  python setup.py install --skip-build \
    --optimize=1 \
    --prefix=/usr \
    --root="${pkgdir}"
  install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
